<template>
    <FormItem :label="`${itemData.label}：`"
              :prop="itemData.name"
              :label-for="itemData.name"
              :rules='itemData.rules'>
        <TreeSelect v-model='formData[itemData.name]'
                    :multiple='itemData.multiple'
                    @on-change='handleChange'
                    show-checkbox
                    :data='dataList' />
    </FormItem>
</template>
<script>

    export default {
        props: {
            itemData: {
                type: Object
            },
            formData: {
                type: Object
            }
        },
        data () {
            return {
                dataList: []
            }
        },
        created () {

        },
        methods: {

            // 改变选中值
            handleChange (value) {
                this.$emit('handleChangeFormData', this.formData);
            }
        }
    }
</script>
